/*
 * @version: vue3
 * @Author: lxs
 * @Date: 2022-04-30 09:44:48
 * @LastEditors: sueRimn
 * @LastEditTime: 2022-05-01 16:37:51
 */
import http from "@/http/http";

// 获取验证码
export function image() {
  return http({
    method: "post",
    url: "/api/sysUser/image",
    responseType: "blob",
  });
}

export interface LoginParm {
  username: string;
  password: string;
  code: string;
}

// 登录
export function login(data: LoginParm) {
  let params = new FormData()
  params.append('username',data.username)
  params.append('password',data.password)
  params.append('code',data.code)
  return http({
    method: "post",
    url: "/api/user/login",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data:params,
  });
}
